<template>
	<view class="xieyi">
		<view class="check" @click="handleCheck">
			<image src="@/static/icon/check.png" mode="aspectFill" style="width: 22rpx;height: 22rpx;" v-if="isCheck"></image>
			<view class="noCheck" v-else></view>
			<text>请先阅读并同意</text>
		</view>
		<view class="link">
			<slot></slot>
		</view>
	</view>
</template>

<script setup>
	import {
		reactive,
		ref,
		computed,
		watchEffect
	} from 'vue'
	const isCheck = ref(false)
	const emit = defineEmits(['update:isCheck'])
	const handleCheck = ()=>{
		isCheck.value = !isCheck.value
		emit('update:isCheck',isCheck.value)
	}
</script>

<style lang="scss" scoped>
	.xieyi{
		display: flex;
		align-items: center;
	}
	.check{
		display: flex;
		align-items: center;
		font-weight: 400;
		font-size: 28rpx;
		color: #5E5E5E;
	}
	.noCheck{
		width: 22rpx;
		height: 22rpx;
		border: 1rpx solid #5E5E5E;
		box-sizing: border-box;
		border-radius: 100%;
	}
	.link{
		color: #1A64FF;
		font-weight: 400;
		font-size: 28rpx;
	}
</style>